unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    btn1: TButton;
    procedure btn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
uses TypInfo;

type
  TMyStrSel =(
     Beijing=0,
     Tianjing=1,
     Shanghai=2,
     Chongqing=3);

procedure TForm1.btn1Click(Sender: TObject);
var
  strSel: TMyStrSel;
  str: string;
begin
  str := 'Chongqing';
  strSel := TMyStrSel(GetEnumValue(TypeInfo(TMyStrSel), str));
  case strSel of
   Beijing: ShowMessage('First');
   Tianjing: ShowMessage('Second');
   Shanghai: ShowMessage('Third');
   Chongqing: ShowMessage('Forth');
   else ShowMessage('Other');
  end;
end;

end.
 